<#--  -->
<#macro pager url total page=1 len=10>	
	<#assign pageCount = (total / len)?ceiling>
		<#if pageCount &gt; 2>
			<#assign selected = page>
			<#assign startPage = selected - 5>
			<#assign endPage = selected + 4>
			<#if startPage &lt; 1>
				<#assign startPage = 1>
				<#assign endPage = selected + 9>
			</#if>
			<#if endPage &gt; pageCount>
				<#assign endPage = pageCount>
			</#if>	
			
			
			<#if selected &gt; 1>
				<a href="${preUrl}/${selected - 1}">&#171; Previous</a>
			</#if>
			<#list startPage..endPage as num>
				<#if selected == num>
					<span class="current">${num}</span>
				<#else>
					<a href="${preUrl}/${num}">${num}</a>
				</#if>
			</#list>
			<#if selected &lt; pageCount>
				<a href="${preUrl}/${selected + 1}">Next &#187;</a>
			</#if>
	</#if>
</#macro>